#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>

int main(int argc, char const *argv[])
{
    pid_t pid = fork();
    if( pid < 0 )
    {
        printf("创建进程失败");
    }
    if( pid > 0 )
    {
        printf("父进程%d执行\n",getpid());
    }else if( pid == 0 )
    {
        char *path = "/home/jiang/桌面/gateway/test/process_test/other";
        char *argv[] = {path ,"abcbd" , NULL};
        char *envp[] = {NULL};  // 环境变量 null表示使用默认环境变量
        execve(path , argv , envp);
    }

    printf("进程:%d执行结束\n",getpid());
    return 0;
}
